#!/bin/sh
#应用名称
app="smart-board"
app_jar=$app".jar"
#jvm参数
jvm_param="-Xmx200m -Xms200m -Xmn150m -Xss1024k"
#日志文件
logfile="smard-board-log.%Y-%m-%d.out"

 process=`ps -fe|grep $app_jar |grep -ivE "grep|cron" |awk '{print $2}'` 
if [ !$process ]; 
then
        echo "stop $app process $process ....."
        kill -9 $process
        sleep 1
fi
echo "start $app process....."
nohup java -Dspring.profiles.active=dev -jar $app_jar $jvm_param --server.servlet.context-path=/ 2>&1 | cronolog $logfile>> /dev/null &
echo "start $app success!"
